package huzh.foundation.dao;

import java.io.Serializable;

/**
 *<p>title:DbPara</p>
 *<p>description:</p>
 * @since 2014-6-7
 * @author huzh
 * @version 1.0
 */
public class DbPara implements Serializable{
    /**serialVersionUID*/
    private static final long serialVersionUID = 7830567429192212200L;

    /**driverName*/
    private String driverName = null;

    /**url*/
    private String url = null;

    /**user*/
    private String user = null;

    /**password*/
    private String password = null;

    /**testSqlClause*/
    private String testSqlClause = null;
    /**initSqlClause*/
    private String initSqlClause;
    /**listenTimer*/
    private long listenTimer = 0L;

    public DbPara(){}

    /**
     * @param driverName
     * @param url
     * @param user
     * @param password
     * @param testSqlClause
     * @param initSqlClause
     */
    public DbPara(String driverName, String url, String user, String password, String testSqlClause, String initSqlClause) {
        this.driverName = driverName;
        this.url = url;
        this.user = user;
        this.password = password;
        this.testSqlClause = testSqlClause;
        this.initSqlClause = initSqlClause;
    }

    /**
     * @return
     */
    public long getListenTimer() {
        return this.listenTimer;
    }

    /**
     * @param listenTimer
     */
    public void setListenTimer(long listenTimer) {
        if (listenTimer < 0L)
            this.listenTimer = 0L;
        else
            this.listenTimer = listenTimer;
    }

    /**
     * @param driverName
     */
    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    /**
     * @param url
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * @param user
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @param testSqlClause
     */
    public void setTestSqlClause(String testSqlClause) {
        this.testSqlClause = testSqlClause;
    }

    /**
     * @return
     */
    public String getDriverName() {
        return this.driverName;
    }

    /**
     * @return
     */
    public String getUrl() {
        return this.url;
    }

    /**
     * @return
     */
    public String getUser() {
        return this.user;
    }

    /**
     * @return
     */
    public String getPassword() {
        return this.password;
    }

    /**
     * @return
     */
    public String getTestSqlClause() {
        return this.testSqlClause;
    }

    /**
     * @return
     */
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("DatabasePara(");
        sb.append("driverName[" + this.driverName + "] -- ");
        sb.append("url[" + this.url + "] -- ");
        sb.append("user[" + this.user + "] -- ");
        sb.append("password[" + this.password + "]");
        sb.append(")");
        return sb.toString();
    }

    /**
     * @return
     */
    public String getInitSqlClause() {
        return this.initSqlClause;
    }

    /**
     * @param initSqlClause
     */
    public void setInitSqlClause(String initSqlClause) {
        this.initSqlClause = initSqlClause;
    }
}
